<template>

	<!-- 收藏页面 -->
	<view>
		<view>
			<u-cell-group>
				<view v-for="item in dataList" >
					<guessYourLike :dataList="item"></guessYourLike>
				</view>
			</u-cell-group>
		</view>

		<u-divider>没有更多了</u-divider>
	</view>
</template>

<script>
	import guessYourLike from '../components/palte/guessYourLike.vue'
	export default {
		data() {
			return {
				dataList: [],
			};
		},
		// onLoad() {
		// 	this.getRoomRecordData()
		// },
		onShow() {
			this.getRoomRecordData()
		},
		methods: {
			//获取用户的收藏记录
			async getRoomRecordData() {
				let getRoomRecordData = await this.$request({
					url: '/v1/collection/list?userId=' + getApp().globalData.userId
				})
				console.log(getRoomRecordData)
				var dataClist = []
				for(let i =0 ;i < getRoomRecordData.data.length; i++){
					let list = [getRoomRecordData.data[i]]
					list.push()
					let houseDataList = {
						"recommandId": 5,
						"plateName": "最新发布",
						"isShowPlateName": false,
						"houseInfo": {
							list: list
						}
					}	
					dataClist.push(houseDataList) 	
				}	
				this.dataList = dataClist
				console.log("getRoomRecordData",this.dataList)
			},
			gotoDetail() {
				wx.navigateTo({
					url: './buyDetail',
					fail: function() {
						console.log("跳转失败")
					},
					success() {
						console.log("成功跳转")
					}
				})
			}
		},
		components: {
			guessYourLike
		}
	}
</script>

<style>
	.hours-lists {
		margin-left: 10rpx;
		margin-top: 10rpx;
		height: 170rpx;
		width: 100%;
		z-index: 100;
	}

	.img-list-box {
		height: 160rpx;
		z-index: 10;
	}

	.img-list {
		height: 160rpx;
		width: 240rpx;
	}
</style>
